<template>
  <div class="table-wrap">
    <div class="item" v-for="(item, index) in content" :key="index">
      <div class="label van-ellipsis">{{ item.label }}</div>
      <div class="value">{{ item.value }}</div>
    </div>
    <div class="empty" v-if="content.length % 2"></div>
  </div>
</template>

<script>
export default {
  props: {
    content: {
      type: Array,
      default: () => {}
    }
  }
};
</script>

<style scoped lang="scss">
.table-wrap {
  margin-top: 12px;
  border: 1px solid #cad2e6;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  .empty {
    border-top: 1px solid #ebebeb;
    background: #fdfdfd;
    height: 34px;
    width: 50%;
  }
  .item {
    > div {
      flex: 1;
      line-height: 34px;
      font-size: 14px;
      border-top: 1px solid #ebebeb;
    }
    &:first-child,
    &:nth-child(2) {
      > div {
        border-top: none;
      }
    }
    .label {
      color: #4d4d4d;
      background: #f5f8fc;
      border-right: 1px solid #ebebeb;
    }
    .value {
      color: #808080;
      border-right: 1px solid #ebebeb;
    }
    &:nth-child(2n) {
      .value {
        border-right: none;
      }
    }
    display: flex;
    width: 50%;
    text-align: center;
  }
}
</style>
